php forum
php mysql forum
php mysql smarty
 
Page 1 of 4 1 2 3 4 >
Topic Options
#313140 - 02/12/07 06:33 PM [7.x] UBB Spoiler Tags
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
NOTE: Spoiler Tags are included in UBB.Threads 7.2.

Author: Gizmo (James of VNC Web Design)

Requirements:
  • Valid UBB.Threads 7.0 install and license


About:
This UBBCode will allow you to hide text in posts from users unless they choose to view it; thus allowing users to post movie, news, etc, spoilers and not have to ruin everyones fun!

Demo:
Please see the attached images:
2361-spoiler-closed.jpg - What people see before the spoiler is revealed.
2362-spoiler-open.jpg - What people see after the spoiler is revealed.

You can also see it in action here.

Install Instructions:
Open libs/ubbthreads.inc.php
Find:
Code:
			array( "#\[email=([+_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4}))\](.+?)\[/email]#i", '<a href="mailto:\1">\5</a>' ),


Add Under:
Code:
			array( "#\[spoiler\](.+?)\[/spoiler\]#i", "<div class=\"ubbcode-block\"><div class=\"ubbcode-header\">Warning, Spoiler: <input type=\"button\" class=\"form-button\" value=\"Show\" onclick=\"if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }\" /></div><div class=\"ubbcode-body\"><div style=\"display: none;\">\\1</div></div></div>" ),


IF you want to add this to the markup panel on the "Full Reply"/"Topic Creation" pages:
Code:
Step 1:
Open templates/default/standardtext_editor.tpl
Find:
<a href="javascript: x()" onclick="DoPrompt('image');" title="{$lang.IMAGE_ALT}" alt="{$lang.IMAGE_ALT}"><img id="image" onmouseover="raiseButton(this.id);" onmouseout="normalButton(this.id);" onmousedown="lowerButton(this.id);" class="markup_panel_normal_button" src="{$config.BASE_URL}/images/{$style_array.markup_panel}/image.gif" /></a>

Add Under:
<a href="javascript: x()" onclick="DoPrompt('spoiler');" title="Spoiler" alt="Spoiler"><img id="spoiler" onmouseover="raiseButton(this.id);" onmouseout="normalButton(this.id);" onmousedown="lowerButton(this.id);" class="markup_panel_normal_button" src="{$config.BASE_URL}/images/{$style_array.markup_panel}/spoiler.gif" /></a>

Step 2:
Open ubb_js/standard_text_editor.js
Find:
	if (action == "image") {
		var thisImage = prompt(enterImage, "http://");
		if (thisImage == null){return;}

		insertAtCaret(document.replier.Body, ' ' + "[img]" + thisImage + "[/img]" + ' ' );
		document.replier.texteditor.focus();
		return;
	}

Add Under:
	if (action == "spoiler") {
		var thisSpoiler = prompt("Enter Spoiler", "");
		if (thisSpoiler == null){return;}

		insertAtCaret(document.replier.Body, ' ' + "[spoiler]" + thisSpoiler + "[/spoiler]" + ' ' );
		document.replier.texteditor.focus();
		return;
	}

Step 3:
You'll need to insert a spoiler.gif into your markup panel directory, I am appending one supplied by Cuervo.


To filter spoilers out of the ActiveTopics system, simply:
Open scripts/activetopics.inc.php
Find:
Code:
		$topics[$i]['forum_id'] = $forum_id;


Add Above:
Code:
		$post_body = preg_replace('/\[spoiler\](.*?)\[\/spoiler\]/si', '', $post_body);
		$post_body = preg_replace('/<div class="ubbcode-block"><div class="ubbcode-header">(.*?)<\/div><div class="ubbcode-body"><div style="display: none;">(.*?)<\/div><\/div><\/div>/si', '', $post_body);


To allow users to specify their own warning:
In libs/ubbthreads.inc.php, add after the [spoiler] tag set:
Code:
			array( "#\[spoiler=(.+?)\](.+?)\[/spoiler\]#i", "<div class=\"ubbcode-block\"><div class=\"ubbcode-header\">\\1 <input type=\"button\" class=\"form-button\" value=\"{$ubbt_lang['SPOILER_SHOW']}\" onclick=\"if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';this.innerText = ''; this.value = '{$ubbt_lang['SPOILER_HIDE']}'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = '{$ubbt_lang['SPOILER_SHOW']}'; }\" /></div><div class=\"ubbcode-body\"><div style=\"display: none;\">\\2</div></div></div>" ),


Usage Instructions:
Code:
[spoiler]This text will be hidden[/spoiler]
[spoiler=This will be the warning]This text will be hidden[/spoiler]


NOTE:
Every time a user visits the page, the spoiler text will be hidden again. Also, multi-level spoilers are not a possibility yet; I'll make that the next project wink. Additionally, the classes used are the standard ubb-code ones.


Attachments
2361-spoiler-closed.jpg (148 downloads)
2362-spoiler-open.jpg (148 downloads)
2369-spoiler.gif

2376-spoiler.gif


_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313142 - 02/12/07 06:42 PM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
gliderdad79 Offline
User

Registered: 03/24/06
Posts: 31
Cool Thanks Giz :wave:

Top
#313147 - 02/12/07 07:52 PM Re: [7.x] UBB Spoiler Tags [Re: gliderdad79]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
If you've already applied this, please update the spoiler ubbcode; there was a bug which would not allow you to quote users when they had a spoiler lol...

And yes, it was some lingering test code wink...


Edited by Gizmo (02/12/07 08:08 PM)
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313148 - 02/12/07 07:55 PM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
by the way, this also fixed multi-level spoilers lol...

By multi level I mean:
Code:
[spoiler][spoiler][spoiler][spoiler]we hide![/spoiler][/spoiler][/spoiler][/spoiler]
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313152 - 02/12/07 09:51 PM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Firstone Offline
Junior Member

Registered: 05/08/01
Posts: 11
Just awesome! Thanks a lot Gizmo smile

(I hope Rick find it usefull too ... laugh )

Top
#313155 - 02/12/07 09:58 PM Re: [7.x] UBB Spoiler Tags [Re: Firstone]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Not a problem... I'm hoping we can get it sneeked into a release as official-ness :crosses fingers:
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313316 - 03/02/07 07:19 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Cuervo Offline
User

Registered: 11/10/01
Posts: 29
Any chance of making this a markup panel button with a pop up?
_________________________
-Cuervo
zOMG and oNOES

Top
#313331 - 03/02/07 06:15 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
I'll look it up later; in all honesty i had no plans of it being in the markup panel so i never bothered; though if it's wanted i'll poke hehe
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313337 - 03/03/07 02:23 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Cuervo Offline
User

Registered: 11/10/01
Posts: 29
Most of my users are very bright when it comes to hand typing uBBcode and it is a nice mod!
_________________________
-Cuervo
zOMG and oNOES

Top
#313338 - 03/03/07 02:32 AM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Completely untested, and taken from the youtube bbcode addon:
Code:
[STEP 1:]
/templates/default/standard_text_editor.tpl

>>FIND
<a href="javascript: x()" onclick="DoPrompt('image');" title="{$lang.IMAGE_ALT}" alt="{$lang.IMAGE_ALT}"><img id="image" onmouseover="raiseButton(this.id);" onmouseout="normalButton(this.id);" onmousedown="lowerButton(this.id);" class="markup_panel_normal_button" src="{$config.BASE_URL}/images/{$style_array.markup_panel}/image.gif" /></a>

>>ADD BELOW
<a href="javascript: x()" onclick="DoPrompt('spoiler');" title="spoiler" alt="spoiler"><img id="spoiler" onmouseover="raiseButton(this.id);" onmouseout="normalButton(this.id);" onmousedown="lowerButton(this.id);" class="markup_panel_normal_button" src="{$config.BASE_URL}/images/{$style_array.markup_panel}/spoiler.gif" /></a>



[STEP 2:]
/ubb_js/standard_text_editor.js

>>FIND
if (action == "image") {
		var thisImage = prompt(enterImage, "http://");
		if (thisImage == null){return;}

		insertAtCaret(document.replier.Body, ' ' + "[img]" + thisImage + "[/img]" + ' ' );
		document.replier.texteditor.focus();
		return;
	}

>>ADD BELOW
if (action == "spoiler") {
		var thisSpoiler = prompt("Enter Spoiler Data", "Spoiler Text");
		if (thisVideo == null){return;}

		insertAtCaret(document.replier.Body, ' ' + "[spoiler]" + thisSpoiler + "[/spoiler]" + ' ' );
		document.replier.texteditor.focus();
		return;
	}

[STEP 3:]
Upload gif to markup panel directory
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313362 - 03/04/07 06:45 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Cuervo Offline
User

Registered: 11/10/01
Posts: 29
Gizmo,

Should I remove the other spoiler mod stuff before adding this in?

And I guess a Monkey Speak No Evil would make a good spoiler gif.
_________________________
-Cuervo
zOMG and oNOES

Top
#313368 - 03/04/07 03:31 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
The "other spoiler stuff" is the code tags in the lib files; those are completely seperate; the stuff i posted above for the editor is just the javascript that creates the editor entries. Youll slso need to put some sort of spoiler image, wasn't sure what to include...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313376 - 03/05/07 07:10 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Cuervo Offline
User

Registered: 11/10/01
Posts: 29
So, are you saying that both of your spoiler mods must be in the code to get the markup part of it to work? Or, you can use either one by itself?
_________________________
-Cuervo
zOMG and oNOES

Top
#313378 - 03/05/07 12:35 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
ADWOFF Offline
Content Queen

Registered: 05/07/01
Posts: 709
Loc: Pennsylvania
Giz, my man, this is way cool! smile

I especially love how you can put a spoiler within a spoiler within a spoiler ...

The only real problem I'm seeing is with Active Topics & the preview. The "spoiler" is revealed ...

~Sue
adwoff.com

Top
#313382 - 03/05/07 04:01 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Originally Posted By: Cuervo
So, are you saying that both of your spoiler mods must be in the code to get the markup part of it to work? Or, you can use either one by itself?
I'm saying, they're both seperate...

The first, lib file addition, HAS TO BE applied for ANYTHING to work; the second, the markup panel crap, can be added IF YOU WANT it...

Sue: sub spoilers rule lol...

As for search engine, Not sure how to suppress it there... I do however believe that if spoilers are critical to your community, they should be posted wiht a description above them, as to filter them out of any search results.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313384 - 03/05/07 04:05 PM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Cuervo Offline
User

Registered: 11/10/01
Posts: 29
Originally Posted By: Gizmo
Originally Posted By: Cuervo
So, are you saying that both of your spoiler mods must be in the code to get the markup part of it to work? Or, you can use either one by itself?
I'm saying, they're both seperate...

The first, lib file addition, HAS TO BE applied for ANYTHING to work; the second, the markup panel crap, can be added IF YOU WANT it...



Thanks, I understand now.
_________________________
-Cuervo
zOMG and oNOES

Top
#313386 - 03/05/07 04:07 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
A lot of people don't care if it's in the markup panel or not, myself included; I only supplied that as a request, and quite frankly, I have no idea if it even works as I never tested it.

The other, the spoiler tags in the lib, has been heavily tested.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313388 - 03/05/07 06:04 PM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Cuervo Offline
User

Registered: 11/10/01
Posts: 29
I did find something while I was trying to install this. I think the part of find:

Code:
<a href="javascript: x()" onclick="DoPrompt('image');" title="{$lang.IMAGE_ALT}" alt="{$lang.IMAGE_ALT}"><img id="image" onmouseover="raiseButton(this.id);" onmouseout="normalButton(this.id);" onmousedown="lowerButton(this.id);" class="markup_panel_normal_button" src="{$config.BASE_URL}/images/{$style_array.markup_panel}/image.gif" /></a>


should read

Code:
<a href="javascript: void(0)" onclick="DoPrompt('image');" title="{$lang.IMAGE_ALT}" alt="{$lang.IMAGE_ALT}"><img id="image" onmouseover="raiseButton(this.id);" onmouseout="normalButton(this.id);" onmousedown="lowerButton(this.id);" class="markup_panel_normal_button" src="{$config.BASE_URL}/images/{$style_array.markup_panel}/image.gif" /></a>


The "javascript: x() is javascript void(0)

I'm not sure on this, but it's what I found in my file.

Something of importance; when you click the markup button it brings up the add spoiler box and lets you add the text, but when you click the ok button it doesn't add the text to the post.

Any ideas on that one, Gizmo?


Edited by Cuervo (03/05/07 07:06 PM)
_________________________
-Cuervo
zOMG and oNOES

Top
#313391 - 03/05/07 06:49 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Yeh, I think some of the javascripts got updated in 7.1; the code I took the "add" line from was for 7.0.2, so it'd make sense wink... good find.

Does the markup option work? (I ask as I haven't applied it as I don't even like using the advanced editor, I mainly only use the quick reply).
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313395 - 03/05/07 07:08 PM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Cuervo Offline
User

Registered: 11/10/01
Posts: 29
I was testing it out just now.

It seems that once you add the text to the popup and click ok it doesn't add the text back to the post.

I'm not sure what needs to change to get the text back in there.


Edited by Cuervo (03/05/07 07:27 PM)
Edit Reason: trying to clear up my post lol
_________________________
-Cuervo
zOMG and oNOES

Top
#313397 - 03/05/07 07:50 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Cuervo Offline
User

Registered: 11/10/01
Posts: 29
I think I found one more issue

Code:
if (action == "spoiler") {
		var thisSpoiler = prompt("Enter Spoiler Data", "Spoiler Text");
		if (thisVideo == null){return;}

		insertAtCaret(document.replier.Body, ' ' + "[spoiler]" + thisSpoiler + "[/spoiler]" + ' ' );
		document.replier.texteditor.focus();
		return;
	}


should read

Code:
if (action == "spoiler") {
		var thisSpoiler = prompt("Enter Spoiler Data", "Spoiler Text");
		if (thisSpoiler == null){return;}

		insertAtCaret(document.replier.Body, ' ' + "[spoiler]" + thisSpoiler + "[/spoiler]" + ' ' );
		document.replier.texteditor.focus();
		return;
	}


There is an instance where thisVideo should read thisSpoiler but I'm not sure if that's why it is not placing the new text in the post. /edit after further testing it appears that this is why the text was not getting posted into the message when you would click ok on the box.


Edited by Cuervo (03/05/07 08:00 PM)
Edit Reason: more testing
_________________________
-Cuervo
zOMG and oNOES

Top
#313399 - 03/05/07 07:55 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Cuervo Offline
User

Registered: 11/10/01
Posts: 29
Well after some more testing is seems the thisSpoiler was the issue.

I have everything working now.

Thanks Gizmo for doing this code bit!!

I attach the spoiler.gif file I'm using.



Attachments
2366-spoiler.gif




Edited by Cuervo (03/05/07 07:58 PM)
_________________________
-Cuervo
zOMG and oNOES

Top
#313405 - 03/05/07 09:39 PM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
I'm not sure, I'll give some hacking a go later...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313407 - 03/05/07 10:37 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
I have this working:
Code:
in templates/default/standardtext_editor.tpl:
<a href="javascript: x()" onclick="DoPrompt('image');" title="{$lang.IMAGE_ALT}" alt="{$lang.IMAGE_ALT}"><img id="image" onmouseover="raiseButton(this.id);" onmouseout="normalButton(this.id);" onmousedown="lowerButton(this.id);" class="markup_panel_normal_button" src="{$config.BASE_URL}/images/{$style_array.markup_panel}/image.gif" /></a>

Add Under:
<a href="javascript: x()" onclick="DoPrompt('spoiler');" title="Spoiler" alt="Spoiler"><img id="spoiler" onmouseover="raiseButton(this.id);" onmouseout="normalButton(this.id);" onmousedown="lowerButton(this.id);" class="markup_panel_normal_button" src="{$config.BASE_URL}/images/{$style_array.markup_panel}/spoiler.gif" /></a>


In ubb_js/standard_text_editor.js:
Find:
	if (action == "image") {
		var thisImage = prompt(enterImage, "http://");
		if (thisImage == null){return;}

		insertAtCaret(document.replier.Body, ' ' + "[img]" + thisImage + "[/img]" + ' ' );
		document.replier.texteditor.focus();
		return;
	}

Add Under:
	if (action == "spoiler") {
		var thisSpoiler = prompt("Enter Spoiler", "");
		if (thisSpoiler == null){return;}

		insertAtCaret(document.replier.Body, ' ' + "[spoiler]" + thisSpoiler + "[/spoiler]" + ' ' );
		document.replier.texteditor.focus();
		return;
	}


You'll need to insert a spoiler.gif into your markup panel directory, I just copied the one for strikethrough
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313408 - 03/05/07 10:42 PM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Original post updated with markup panel instructions.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313409 - 03/05/07 10:43 PM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
BTW, totally missed your second post lol
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313410 - 03/05/07 10:53 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
I cleaned up the spoiler graphic a bit, at least it looks good with a colored background, versus having a load of white shoved into it wink
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313430 - 03/07/07 11:24 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
I added another spoiler graphic; additionally, a thought to some on this... You could adapt it as a "not safe for work" tag... I've seen some communities whine about such things wink...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313436 - 03/08/07 02:03 AM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Added a regex filter to my initial post to filter spoiler content out of Active Topics.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313437 - 03/08/07 02:12 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Cuervo Offline
User

Registered: 11/10/01
Posts: 29
Originally Posted By: Gizmo
I added another spoiler graphic; additionally, a thought to some on this... You could adapt it as a "not safe for work" tag... I've seen some communities whine about such things wink...


Another outstanding use for this mod!
_________________________
-Cuervo
zOMG and oNOES

Top
#313438 - 03/08/07 02:18 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
ADWOFF Offline
Content Queen

Registered: 05/07/01
Posts: 709
Loc: Pennsylvania
Originally Posted By: Gizmo
IF you wish to filter "spoiler content" from Active Topics:
open scripts/activetopics.inc.php
Find:
Code:
		$topics[$i]['forum_id'] = $forum_id;


Add Above:
Code:
		$post_body = preg_replace('/\[spoiler\](.*?)\[\/spoiler\]/si', '', $post_body);


Heya Giz~

I gave this a shot, and it did not take. frown

The spoiler part works, but it doesn't hide the text in Active Topics.

_________________________
Sue
adwoff.com

Top
#313439 - 03/08/07 02:23 AM Re: [7.x] UBB Spoiler Tags [Re: ADWOFF]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Cuervo: lol i noticed somethign last night when poking around a gardening sites forum, I laughed for like 20 minutes thinking of the "inappropriate lawn gnomes" I stumbled on, and the person who was at work who opened it...

Sue: Very odd, it works on my 7.1 demo site... I'll poke in and take a gander in a bit.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313440 - 03/08/07 02:28 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Hmmm, seems that the active topics doesn't show the tags themselves when they're parsed (duah on my part, I can't believe I didn't think about that)...

I'll need to think, because I believe the data in the active topics doesn't take tags used into account...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313441 - 03/08/07 02:48 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
I'm still working on the regex, I'm not sure what's wrong with it yet... It seems like something isn't parsing on it, but so far what I have is:
Code:
		$post_body = preg_replace('/<div class="ubbcode-block"><div class="ubbcode-header">Warning, Spoiler: <input type="button" value="Show" (.*?) \/><\/div><div class="ubbcode-body"><div style="display: none;">(.*?)<\/div><\/div><\/div>/si', '', $post_body);


It'll at least retard the viewing of the spoiler, well, the post in general... I'll try to get it working as soon as i can figure out what i'm b0gging lol
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313442 - 03/08/07 03:02 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Well, seems that works just fine and Ive been working on n issue which wasn't there lol... I made a couple spoiler posts to test the regex on, and turns out that the one i was working with, didn't have any other content in the post; so when it filtered the spoiler, i was going nutty lol...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313443 - 03/08/07 03:13 AM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
updated initial posting:
1. New spoiler graphic.
2. Updated spoiler code, now uses the style for forum buttons.
3. Added regex entries for scripts/activetopics.inc.php to filter out all spoiler entries from the activetopics.

Also, if you want to display [spoiler] instead of no spoiler text, in the new entries in the activetopics.inc.php simply put in:
Code:
		$post_body = preg_replace('/\[spoiler\](.*?)\[\/spoiler\]/si', '[spoiler]', $post_body);
		$post_body = preg_replace('/<div class="ubbcode-block"><div class="ubbcode-header">(.*?)<\/div><div class="ubbcode-body"><div style="display: none;">(.*?)<\/div><\/div><\/div>/si', '[spoiler]', $post_body);


instead of
Code:
		$post_body = preg_replace('/\[spoiler\](.*?)\[\/spoiler\]/si', '', $post_body);
		$post_body = preg_replace('/<div class="ubbcode-block"><div class="ubbcode-header">(.*?)<\/div><div class="ubbcode-body"><div style="display: none;">(.*?)<\/div><\/div><\/div>/si', '', $post_body);
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313470 - 03/10/07 05:03 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Cuervo Offline
User

Registered: 11/10/01
Posts: 29
Originally Posted By: Gizmo
Cuervo: lol i noticed somethign last night when poking around a gardening sites forum, I laughed for like 20 minutes thinking of the "inappropriate lawn gnomes" I stumbled on, and the person who was at work who opened it...

Sue: Very odd, it works on my 7.1 demo site... I'll poke in and take a gander in a bit.


I could so see someone telling their boss to come look at this site, it has a great post about growing tomatoes and woops!
_________________________
-Cuervo
zOMG and oNOES

Top
#313474 - 03/10/07 02:12 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Lol it was on topic... IT was talking about lawn gnomes haha...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313592 - 03/17/07 07:07 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
jgeoff Offline
Power User

Registered: 04/05/01
Posts: 97
Loc: NJ

Giz, I'm getting this error in 7.1 (I didn't apply any of the markup panel stuff)

Parse error: syntax error, unexpected T_STRING, expecting ')' in /home2/gbb/public_html/threads/libs/ubbthreads.inc.php on line 1011
_________________________
GangsterBB.NET (Ver. 7.3)
2007 Content Rulez Contest - Honorable Mention
UBB.classic 6.7.2 - RIP
Browser: Firefox 2.0

Top
#313594 - 03/17/07 08:23 PM Re: [7.x] UBB Spoiler Tags [Re: jgeoff]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Could you paste me exactly what you put in the ubbcode block for the spoiler tag? What it looks like is that you're missing the ),
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313597 - 03/18/07 01:57 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
jgeoff Offline
Power User

Registered: 04/05/01
Posts: 97
Loc: NJ
Originally Posted By: Gizmo
Could you paste me exactly what you put in the ubbcode block for the spoiler tag? What it looks like is that you're missing the ),

All I did was type
Click to reveal..
test
smirk

The error came up in Post Preview - I never actually posted it. Not sure if that makes a difference...

_________________________
GangsterBB.NET (Ver. 7.3)
2007 Content Rulez Contest - Honorable Mention
UBB.classic 6.7.2 - RIP
Browser: Firefox 2.0

Top
#313600 - 03/18/07 04:25 AM Re: [7.x] UBB Spoiler Tags [Re: jgeoff]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
well, the error is with the ubbcode insert in the lib file; i need to know exactly what you inserted to troubleshoot it lol
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313603 - 03/18/07 11:54 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
jgeoff Offline
Power User

Registered: 04/05/01
Posts: 97
Loc: NJ

Sorry, I misunderstood what you were asking blush

I put this in libs/ubbthreads.inc.php, the same code you provided, after the email line as directed:
Code:
array( "#\[spoiler\](.+?)\[/spoiler\]#i", "<div class=\"ubbcode-block\"><div class=\"ubbcode-header\">Warning, Spoiler: <input type=\"button\" class="form-button" value=\"Show\" onclick=\"if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }\" /></div><div class=\"ubbcode-body\"><div style=\"display: none;\">\\1</div></div></div>" ),


And not only do I get the following error, but it prevents the entire forum from loading up. I get a white screen with:
Quote:

Parse error: syntax error, unexpected T_STRING, expecting ')' in /home2/gbb/public_html/threads/libs/ubbthreads.inc.php on line 1011


confused
_________________________
GangsterBB.NET (Ver. 7.3)
2007 Content Rulez Contest - Honorable Mention
UBB.classic 6.7.2 - RIP
Browser: Firefox 2.0

Top
#313609 - 03/18/07 04:17 PM Re: [7.x] UBB Spoiler Tags [Re: jgeoff]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
I'm certainly hoping you're posting the content of your file vs the first post in this thread lol...

I don't honestly see why you'd be getting this issue; could you email me your libs/ubbthreads.inc.php so I can take a look? james[at]virtualnightclub[dot]net.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313618 - 03/19/07 12:08 PM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
jgeoff Offline
Power User

Registered: 04/05/01
Posts: 97
Loc: NJ

Of course I copied/pasted it from my file - lol - but I'll email it to you anyway... laugh
_________________________
GangsterBB.NET (Ver. 7.3)
2007 Content Rulez Contest - Honorable Mention
UBB.classic 6.7.2 - RIP
Browser: Firefox 2.0

Top
#313619 - 03/19/07 01:27 PM Re: [7.x] UBB Spoiler Tags [Re: jgeoff]
Fred Johnson Offline
Junior Member

Registered: 07/14/06
Posts: 21
Gizmo,

This looked like a cool addon so I tried it as well, I got the same error. I simply copied/pasted the one line in your first post and saved the file. I got the same error and removed it.

Fred

Top
#313620 - 03/19/07 01:33 PM Re: [7.x] UBB Spoiler Tags [Re: Fred Johnson]
Fred Johnson Offline
Junior Member

Registered: 07/14/06
Posts: 21
Found the error. You were missing the escape characters for the added "class" part.

Should be:
Code:
array( "#\[spoiler\](.+?)\[/spoiler\]#i", "<div class=\"ubbcode-block\"><div class=\"ubbcode-header\">Warning, Spoiler: <input type=\"button\" class=\"form-button\" value=\"Show\" onclick=\"if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }\" /></div><div class=\"ubbcode-body\"><div style=\"display: none;\">\\1</div></div></div>" ),


Fred

Top
#313621 - 03/19/07 03:10 PM Re: [7.x] UBB Spoiler Tags [Re: Fred Johnson]
Fred Johnson Offline
Junior Member

Registered: 07/14/06
Posts: 21
Hmmm, I added everything like in the instructions, but I can't get the window to "popup."

I did change void(x) to void (0) to match the others as in:
Code:
<a href="javascript: void(0)" onclick="DoPrompt('spoiler');" title="Spoiler" alt="Spoiler"><img id="spoiler" onmouseover="raiseButton(this.id);" onmouseout="normalButton(this.id);" onmousedown="lowerButton(this.id);" class="markup_panel_normal_button" src="{$config.BASE_URL}/images/{$style_array.markup_panel}/spoiler.gif" /></a> 



Still no dice.

Top
#313622 - 03/19/07 03:39 PM Re: [7.x] UBB Spoiler Tags [Re: Fred Johnson]
jgeoff Offline
Power User

Registered: 04/05/01
Posts: 97
Loc: NJ

Good eye, Fred! Mine's working properly now... cool
It was the class=\"form-button\" missing the slashes...

_________________________
GangsterBB.NET (Ver. 7.3)
2007 Content Rulez Contest - Honorable Mention
UBB.classic 6.7.2 - RIP
Browser: Firefox 2.0

Top
#313623 - 03/19/07 03:46 PM Re: [7.x] UBB Spoiler Tags [Re: jgeoff]
Fred Johnson Offline
Junior Member

Registered: 07/14/06
Posts: 21
Are you using the markup panel? I have gotten the spoiler part to work, but not the markup panel. It shows the button, will highlight it and when you mouse over it, it says "spoiler" and at the bottom (status bar) you can see where it will call javascript like the others, but when you click the button nothing happens.

Top
#313624 - 03/19/07 03:57 PM Re: [7.x] UBB Spoiler Tags [Re: Fred Johnson]
Fred Johnson Offline
Junior Member

Registered: 07/14/06
Posts: 21
Weird, I had to exit out of IE all together and come back and now the spoiler button is working...

FYI


Top
#313625 - 03/19/07 04:02 PM Re: [7.x] UBB Spoiler Tags [Re: Fred Johnson]
jgeoff Offline
Power User

Registered: 04/05/01
Posts: 97
Loc: NJ

No, I didn't include it in the markup panel, but glad yours is working now... cool


_________________________
GangsterBB.NET (Ver. 7.3)
2007 Content Rulez Contest - Honorable Mention
UBB.classic 6.7.2 - RIP
Browser: Firefox 2.0

Top
#313627 - 03/19/07 04:11 PM Re: [7.x] UBB Spoiler Tags [Re: jgeoff]
Fred Johnson Offline
Junior Member

Registered: 07/14/06
Posts: 21
Oh, one more FYI, the gif file is about 1 or 2 pixels too big (tall-height).

Edit: I removed a pixel from the top and it matches up now.


Attachments
2375-Spoiler.gif




Edited by Fred Johnson (03/19/07 04:19 PM)

Top
#313628 - 03/19/07 04:21 PM Re: [7.x] UBB Spoiler Tags [Re: Fred Johnson]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
The markup panel addon should work, i tested it like once then removed it from my board.

As for the class, blaime it on me... I added that like a week or so ago and just updated it here vs taking from my live board lol... I'll update first post now...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313629 - 03/19/07 04:23 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Ok, first post updated.

As for the markup panel working after you closed your browser; your browser was caching the lib file.

AS for the gif being "too big", I'll get it updated to freds; the one I supplied was the ! which should be the proper size.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313631 - 03/19/07 05:22 PM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Fred Johnson Offline
Junior Member

Registered: 07/14/06
Posts: 21
Gizmo,

Well, I thought it was all working, but I have found out that now if someone uses a spoiler tag in a post no one can edit either their post or any post in the topic (even if posted after the spoiler tag post).

Any ideas?

Top
#313632 - 03/19/07 05:40 PM Re: [7.x] UBB Spoiler Tags [Re: Fred Johnson]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
I don't see how it'd happen actually, could you link me to an example of this?
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313633 - 03/19/07 05:47 PM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Fred Johnson Offline
Junior Member

Registered: 07/14/06
Posts: 21
Sent you a PM.

Click to reveal..
Test


Can someone else with this mod installed post a spoiler in a topic and then try to edit their post?

Does it let you?

Fred


Edited by Fred Johnson (03/19/07 06:03 PM)

Top
#313634 - 03/19/07 06:53 PM Re: [7.x] UBB Spoiler Tags [Re: Fred Johnson]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Allows me just fine on 3 installs, hence why i dont see why this would error...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313635 - 03/19/07 07:32 PM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
jgeoff Offline
Power User

Registered: 04/05/01
Posts: 97
Loc: NJ

No problems here. It's a tag like any other, so doesn't make sense to me, either... confused
_________________________
GangsterBB.NET (Ver. 7.3)
2007 Content Rulez Contest - Honorable Mention
UBB.classic 6.7.2 - RIP
Browser: Firefox 2.0

Top
#313636 - 03/19/07 07:41 PM Re: [7.x] UBB Spoiler Tags [Re: jgeoff]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
I can't see how it COULD mess with the edit post timer (the erorr is generated from that), all this mod does is insert html/ubbcode into the database which any post-based mod would do... The worse that could occour would be that the connection to the server died mid-packet and not all html was inserted; which would be near impossible and woudln't be related lol...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313639 - 03/19/07 08:23 PM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
After digging further we discovered that Fred's issues derived from a separate issue which was in no part related to this modification.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313640 - 03/19/07 09:30 PM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Fred Johnson Offline
Junior Member

Registered: 07/14/06
Posts: 21
Yep,

Gizmo sure is a trooper! He logged into my site and saw I wasn't nuts, well at least that something was wrong. whistle

I backed out all of the mods and I was still having the problem so I then went a little deeper and remembered that earlier today I had made a code change listed on the main UBB site for a v7.1.1 fix. I usually read the fixes, try them out and update my code as Rick lists them, but this one is what broke the page. I'll have to tell him about it (tomorrow, it's late now).

Anyway, this mod works great, you should try it, it is a neat feature (not sure why it isn't here yet?).

Fred

Top
#313641 - 03/19/07 09:37 PM Re: [7.x] UBB Spoiler Tags [Re: Fred Johnson]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Oh, it will be here wink... just you wait hehe...

And yeh, if you applied a fix schedualed for 7.1.1 then you definitely should report it; odd that it b0ged things this badly though lol...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313643 - 03/20/07 01:04 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
jgeoff Offline
Power User

Registered: 04/05/01
Posts: 97
Loc: NJ

Fine, don't tell the rest of us what conflicted with it... tipsy wink

_________________________
GangsterBB.NET (Ver. 7.3)
2007 Content Rulez Contest - Honorable Mention
UBB.classic 6.7.2 - RIP
Browser: Firefox 2.0

Top
#313644 - 03/20/07 05:22 AM Re: [7.x] UBB Spoiler Tags [Re: jgeoff]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
According to Fred, it was one of the proposed 7.1.1 fixes at UBBCentral; he'll be making a post about it there later on today.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313645 - 03/20/07 08:02 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Fred Johnson Offline
Junior Member

Registered: 07/14/06
Posts: 21
To be specific it was the modify.inc.php one where on line 94 you change the T2 to a T1. Don't do it...

Top
#313653 - 03/20/07 05:11 PM Re: [7.x] UBB Spoiler Tags [Re: Fred Johnson]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Originally Posted By: Fred Johnson
Don't do it...
But, that makes me want to do it...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313662 - 03/21/07 08:42 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Fred Johnson Offline
Junior Member

Registered: 07/14/06
Posts: 21
Then do it, but don't.

How's that?

I guess you could call it a "feature." Only the topic generator can edit a post in the topic for x amount of minutes... tipsy

Top
#313670 - 03/21/07 04:20 PM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Cuervo Offline
User

Registered: 11/10/01
Posts: 29
Originally Posted By: Gizmo
Originally Posted By: Fred Johnson
Don't do it...
But, that makes me want to do it...


/agree Now I HAVE to try it! lol
_________________________
-Cuervo
zOMG and oNOES

Top
#313671 - 03/21/07 04:26 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Cuervo Offline
User

Registered: 11/10/01
Posts: 29
What about spoilers based on User Group? j/k
_________________________
-Cuervo
zOMG and oNOES

Top
#313673 - 03/21/07 05:14 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Lol that could be interesting; not sure how it'd work lol, but interesting none the less...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313739 - 03/29/07 02:00 PM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
jgeoff Offline
Power User

Registered: 04/05/01
Posts: 97
Loc: NJ

Just to boost your ego a bit... laugh

Quote:

Those spoiler tags are the coolest things ever.

Quote:

This is an AWESOME feature Geoff, thanks!

Quote:

I like it Geoff!! smile Great idea!!


Thanks for making me look good! laugh wink

_________________________
GangsterBB.NET (Ver. 7.3)
2007 Content Rulez Contest - Honorable Mention
UBB.classic 6.7.2 - RIP
Browser: Firefox 2.0

Top
#313741 - 03/29/07 05:17 PM Re: [7.x] UBB Spoiler Tags [Re: jgeoff]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
haha, makes me feel much better today! (sick as a dog)
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#314318 - 06/04/07 02:55 PM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
i must echo the sentiments.. spoiler mod is sooooo much of a great idea!!

thanks

ps: should put this mod in the core :2c:
_________________________

Top
#314320 - 06/04/07 06:20 PM Re: [7.x] UBB Spoiler Tags [Re: sirdude]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Originally Posted By: sirdude
ps: should put this mod in the core :2c:
wink
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#314748 - 07/16/07 10:00 PM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
I added code which would allow users to specify a warning; it can come quite helpful if they wanted something other than the generic "Warning, Spoiler", they could have "Chapter 6, Title" and have it run into the spoiler.

Originally Posted By: Gizmo
To allow users to specify their own warning:
In libs/ubbthreads.inc.php, add after the [spoiler] tag set:
Code:
			array( "#\[spoiler=(.+?)\](.+?)\[/spoiler\]#i", "<div class=\"ubbcode-block\"><div class=\"ubbcode-header\">\\1 <input type=\"button\" class=\"form-button\" value=\"{$ubbt_lang['SPOILER_SHOW']}\" onclick=\"if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';this.innerText = ''; this.value = '{$ubbt_lang['SPOILER_HIDE']}'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = '{$ubbt_lang['SPOILER_SHOW']}'; }\" /></div><div class=\"ubbcode-body\"><div style=\"display: none;\">\\2</div></div></div>" ),


Usage Instructions:
Code:
[spoiler=This will be the warning]This text will be hidden[/spoiler]
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#314754 - 07/17/07 08:28 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
hrm, i wonder where that idea came from.. whistle

glad you added it wink
_________________________

Top
#314768 - 07/17/07 07:17 PM Re: [7.x] UBB Spoiler Tags [Re: sirdude]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Well, it's been in for quite a while (in my bbcode that I transfer everywhere), I just adapted it for UBB7.2 and mailed it to Rick for 7.2 but it didn't get in :tear:
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#318668 - 01/10/11 01:53 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
lysaraj Offline
Lurker

Registered: 01/10/11
Posts: 3
It is too good for those users who are not well knowledge about UBB Spoiler Tags. You can get entire information which you want. Thank you
_________________________
mcts dumps|cwna certification|Testkings|mcp exam

Top
Page 1 of 4 1 2 3 4 >



Moderator:  sirdude 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks